﻿using Agile.Shared.WebApi.Authentication;
using Agile.Shared.WebApi.Authorization;
using Agile.Shared.WebApi.Registrar;

namespace Agile.Service.Admin.WebApi
{
    public sealed class AdminWebApiDependencyRegistrar : AbstractWebApiDependencyRegistrar
    {
        public AdminWebApiDependencyRegistrar(IServiceCollection services)
        : base(services)
        {
        }

        public AdminWebApiDependencyRegistrar(IApplicationBuilder app)
            : base(app)
        {
        }

        public override void AddAgile()
        { 
            AddWebApiDefault<BearerAuthenticationRemoteProcessor, PermissionRemoteHandler>();
            //AddHealthChecks(true, true, true, false);
            //Services.AddGrpc();
        }

        public override void UseAgile()
        {
            UseWebApiDefault(endpointRoute: endpoint =>
            {
                //endpoint.MapGrpcService<Grpc.AuthGrpcServer>();
               // endpoint.MapGrpcService<Grpc.UsrGrpcServer>();
            });
        }
    }
}
